﻿Imports System.IO
Imports TNCDAL

Public Class DBController
    Dim _objDBRepository As New DBRepository
    Public Function BackupDatabase(ByVal backupFile As String, ByVal dbName As String) As Boolean
        Dim kq As Boolean = False
        Try
            'Xóa backup file nếu tồn tại
            If File.Exists(backupFile) Then
                File.Delete(backupFile)
            Else
                File.Create(backupFile)
            End If
            kq = _objDBRepository.BackupDatabase(dbName, backupFile)
        Catch ex As Exception
            Throw ex
        End Try
        Return kq
    End Function
End Class
